﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Region.aspx.cs" Inherits="School.Pages.Bus.Region" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table align="right" dir="rtl" style="width: 964px">
            <tr>
                <td>
                    المجمع
                </td>
                <td>
                    <asp:DropDownList ID="ddCamp" runat="server" DataTextField="Name" DataValueField="Id"
                        Width="200px" AppendDataBoundItems="True">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddCamp"
                        Display="Dynamic" ErrorMessage="*" Font-Size="Medium" ForeColor="Red" InitialValue="-1"
                        ValidationGroup="re">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    كود المنطقة
                </td>
                <td>
                    <asp:TextBox ID="txtcode" runat="server" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtcode"
                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="re">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    إسم المنطقة
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtName"
                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="re"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnSave" runat="server" Text="حفظ" ValidationGroup="re" OnClick="btnSave_Click" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Literal ID="lbltest" runat="server" Visible="False"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:GridView ID="gvRegion" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                        OnRowCancelingEdit="gvRegion_RowCancelingEdit" OnRowDeleting="gvRegion_RowDeleting"
                        OnRowEditing="gvRegion_RowEditing" OnRowUpdating="gvRegion_RowUpdating" Width="745px"
                        AllowPaging="True" OnPageIndexChanging="gvRegion_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="المجمع" ReadOnly="True">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="إسم المنطقة" SortExpression="DistName">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtN" runat="server" Text='<%# Bind("DistName") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtN"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="gvr">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("DistName") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="كود المنطقة" SortExpression="Dis_Code">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtC" runat="server" Text='<%# Bind("Dis_Code") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtC"
                                        Display="Dynamic" ErrorMessage="*" ValidationGroup="gvr" ForeColor="Red">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Dis_Code") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:CommandField CancelText="إلغاء" EditText="تعديل" ShowEditButton="True" UpdateText="تحديث"
                                ValidationGroup="gvr">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:CommandField>
                            <asp:CommandField DeleteText="حذف" ShowDeleteButton="True">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:CommandField>
                        </Columns>
                        <EmptyDataTemplate>
                            لا توجد بيانات
                        </EmptyDataTemplate>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <hr />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
